package com.nmc.core.dao;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

import com.nmc.model.Settings;

public class SettingsDAOImpl extends BaseDAO implements SettingsDAO{

	public Settings getValue(String key) {
		Session session = this.getSession();
		
        Criteria c = session.createCriteria(Settings.class);
		c.add(Restrictions.eq("key",key));

		if(c.list() != null && c.list().size() > 0)
			return (Settings)c.list().get(0);
		else {
			return null;	
		}
	}

}
